* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto;
}

.container {
    position: relative;
    width: 100%;
    max-width: 800px;
    padding: 20px;
    margin: 20px auto;
}

.envelope {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 40px;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.envelope:hover {
    transform: translateY(-10px) rotateX(5deg);
}

.envelope-flap {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: #ff6b6b;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation: flap 2s infinite;
}

.letter {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.letter-content {
    text-align: center;
}

h1 {
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.date {
    color: #666;
    margin-bottom: 30px;
    font-style: italic;
}

.message {
    margin: 30px 0;
    line-height: 1.8;
    color: #333;
}

.heart-text {
    color: #ff6b6b;
    font-size: 1.5em;
    font-weight: bold;
    animation: heartbeat 1.5s infinite;
}

.signature {
    margin-top: 40px;
    font-style: italic;
    color: #666;
}

.name {
    font-size: 1.2em;
    color: #ff6b6b;
    margin-top: 10px;
}

.floating-hearts {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

@keyframes flap {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    50% { transform: translateX(-50%) rotate(10deg); }
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    .envelope {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
}

.love-messages {
    margin: 30px 0;
    height: 120px;
    overflow: hidden;
    position: relative;
}

.love-message {
    position: absolute;
    width: 100%;
    text-align: center;
    color: #ff6b6b;
    font-size: 1.2em;
    opacity: 0;
    transform: translateY(20px);
    animation: messageSlide 12s infinite;
    padding: 20px 0;
    line-height: 1.8;
    top: 0;
    left: 0;
}

.love-message:nth-child(1) { animation-delay: 0s; }
.love-message:nth-child(2) { animation-delay: 12s; }
.love-message:nth-child(3) { animation-delay: 24s; }
.love-message:nth-child(4) { animation-delay: 36s; }
.love-message:nth-child(5) { animation-delay: 48s; }
.love-message:nth-child(6) { animation-delay: 60s; }

@keyframes messageSlide {
    0%, 5% {
        opacity: 0;
        transform: translateY(20px);
    }
    10%, 90% {
        opacity: 1;
        transform: translateY(0);
    }
    95%, 100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.interactive-area {
    margin: 40px 0;
    text-align: center;
}

.memory-photos {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.photo-frame {
    width: 120px;
    height: 120px;
    border: 3px solid #ff6b6b;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
}

.photo-frame:hover {
    transform: scale(1.1);
}

.photo-content {
    width: 100%;
    height: 100%;
    background: rgba(255, 107, 107, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff6b6b;
    font-size: 0.9em;
    text-align: center;
    padding: 10px;
}

.love-counter {
    margin-top: 30px;
    color: #ff6b6b;
}

.counter {
    font-size: 2.5em;
    font-weight: bold;
    margin: 10px 0;
    animation: countUp 2s ease-out forwards;
}

.music-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

#musicToggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #ff6b6b;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

#musicToggle:hover {
    transform: scale(1.1);
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 弹窗样式 */
.memory-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.memory-popup.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

.popup-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    animation: scaleIn 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    max-width: 80%;
    width: 400px;
}

.popup-content h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.popup-content p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.popup-buttons {
    margin-top: 20px;
}

.close-popup {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    transition: transform 0.2s ease;
}

.close-popup:hover {
    transform: scale(1.05);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

.memory-section {
    margin: 40px 0;
    padding: 20px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 15px;
}

.memory-title {
    color: #ff6b6b;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.memory-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.memory-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.memory-item:hover {
    transform: translateY(-5px);
}

.memory-item h4 {
    color: #ff6b6b;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.memory-item p {
    color: #666;
    line-height: 1.6;
}

/* 欢迎弹窗样式 */
.welcome-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 107, 107, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.5s ease;
}

.welcome-content {
    text-align: center;
    color: white;
    padding: 30px;
    animation: scaleIn 0.5s ease;
}

.welcome-content h2 {
    font-size: 2em;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.welcome-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
    line-height: 1.6;
}

.start-button {
    background: white;
    color: #ff6b6b;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.start-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
} 